// comment.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    haoPing: '../../images/pic/ic_haoping_s.png',
    zhongPing: '../../images/pic/ic_zhongping_n.png',
    chaPing: '../../images/pic/ic_chaping_n.png'
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },

  /**
   * 好评
   */
  imgHaoPing: function () {
    var that = this
    console.log('haoping')
    that.setBackgroundImg('../../images/pic/ic_haoping_s.png',
      '../../images/pic/ic_zhongping_n.png',
      '../../images/pic/ic_chaping_n.png')

  },

  /**
   * 中评
   */
  imgZhongPing: function () {
    var that = this
    console.log('zhongping')
    that.setBackgroundImg('../../images/pic/ic_haoping_n.png',
      '../../images/pic/ic_zhongping_s.png',
      '../../images/pic/ic_chaping_n.png')
  },

  /**
   * 差评
   */
  imgChaPing: function () {
    var that = this
    console.log('chaping')
    that.setBackgroundImg('../../images/pic/ic_haoping_n.png',
      '../../images/pic/ic_zhongping_n.png',
      '../../images/pic/ic_chaping_s.png')
  },

  /**
   * 设置图片
   */
  setBackgroundImg: function (haoPing, zhongPing, chaPing) {
    var that = this;
    that.setData({
      haoPing: haoPing,
      zhongPing: zhongPing,
      chaPing: chaPing,
    })
  }
})